<?php if(!empty($user)): ?>

<div class="span4 pull-right">
  <div class="row">

    <div class="span1">
      <div class="row">
        <?php if(isset($user->picture)): ?>
        <?php $image = image_style_url('user_thumbnail', $user->picture->uri); ?>
        <?php print l('<img src="'.$image.'" title="'.$user->name.'" alt="'.$user->name.'"></a>', 'account', array('html' => true)); ?>
        <?php endif; ?>
      </div>
    </div>

    <div class="span3">
      <ul class="row menu">
        <li><strong><?php print l($user->name, 'account'); ?></strong></li>
      </ul>
      <div class="row">

        <div class="span2">
          <ul class="menu row">
            <li><?php print l(t('Messages'), 'account/messages'); ?>&nbsp;<span class="badge badge-info new_conversations none">33</span></li>
          </ul>
        </div>

        <div class="span1">
          <ul class="menu row">
            <li><?php print l(t('Exit'), 'user/logout', array('attributes' => array('class' => array()))); ?></li>
          </ul>
        </div>

      </div>
    </div>

  </div>
</div>

<?php endif; ?>